<%@ page language="java" contentType="text/html; charset=UTF-8"%>
<%
	String path = request.getContextPath() + "/";
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path;
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<base href="<%=basePath%>">
<meta charset="UTF-8">
<title>设备首页</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="css/d_common.css">
<script src="js/jquery-1.9.1.js"></script>
<script src="js/layer/layer.js"></script>
<script>
var i = 120;
Timeout();
function Timeout(){
	if(i>0){
		i--;
		setTimeout(function(){Timeout();},1000);
	}else{
		$.ajax({
			async : false,
			cache : false,
			type : 'post',
			dataType : "json",
			url :  'declaimer/removeDeviceUse?devicecode=${devicecode }',// 请求的action路径
			error : function(XMLHttpRequest, textStatus, errorThrown) {
				layer.msg("请求失败！");
			},
			success : function(data) {
				window.location.reload();
			}
		});	
	}
}
function gotoChoose(){
	$.ajax({
		async : false,
		cache : false,
		type : 'post',
		dataType : "json",
		url :  'declaimer/findUser?devicecode=${devicecode }',// 请求的action路径
		error : function(XMLHttpRequest, textStatus, errorThrown) {
			layer.msg("请求失败！");
		},
		success : function(data) {
			if(data.state=="1"){
				setTimeout("gotoPage('"+data.message+"')",100);
			}else{
				layer.msg(data.message,{icon:0});
			}
		}
	});	
}
function gotoPage(cardno){
	window.location.href="<%=basePath%>declaimer/mtype?guid=${guid }&devicecode=${devicecode}&cardno="+cardno;
}
</script>
</head>
<body class="bg1">
<div class="header">
    <div class="logo"><a href="javascript:void(0);"><img src="img/n_logo.png" alt=""></a></div>
    <%--<div class="user">
        <img src="img/man.png" alt="">
        <div class="admin">
            <span class="name">${user.name }</span><br>
            <span class="number">${user.cardno }</span>
        </div>
    </div>
--%></div>
<div class="main">
    <ul class="list clear">
        <li>
            <a href="javascript:void(0);" onclick="gotoChoose();" class="reader">
                <img src="img/200-1.png" alt=""><br>
                <span>开始朗读</span>
            </a>
        </li>
        <li>
            <a href="javascript:;" class="rank">
                <img src="img/200-2.png" alt=""><br>
                <span>查看排名</span>
            </a>
        </li>
        <li>
            <a href="javascript:;" class="activity">
                <img src="img/200-3.png" alt=""><br>
                <span>参加活动</span>
            </a>
        </li>
        <li style="margin-right: 0;">
            <a href="javascript:;"class="expect">
                <img src="img/200-4.png" alt=""><br>
                <span>更多...</span>
            </a>
        </li>
    </ul>
</div>

<div class="footer">
	<div style="height:225px;">
    <ul>
        <li><span></span>关于服务器维护的紧急通知</li>
        <li><span></span>2017年阅读推广公益活动洽谈文化志愿者招募</li>
    </ul>
    <img src="https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket=${ticket }" alt="" class="footerimg1">
    </div>
    <div style="text-align: center;line-height: 60px;">
	   <!--    <b>Version</b> 1.0.0
	    <strong>Copyright &copy; 2017 <a href="#" style="color:#000;">厦门信昇达教育科技有限公司</a>.</strong> All rights
	    reserved. -->
	  </div>
</div>
</body>
</html>